package yxy.cherry.battle.module.affix.condition;

import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.module.affix.AffixContext;
import yxy.cherry.battle.module.affix.AffixContext.AffixActionClass;

@AffixconditionType(Type = 8)
public class AffixCondition_08_法攻时 extends AffixCondition {

	public AffixCondition_08_法攻时(int param) {
		super(param);
	}

	@Override
	public boolean checkOne(Fighter actor) {
		AffixContext affixContext = actor.getAffixContext();
		if (affixContext.is附加行动中()) {
			return affixContext.get附加行动().get行动类型().contains(AffixActionClass.法术攻击);
		}
		return affixContext.get攻击行动().get行动类型().contains(AffixActionClass.法术攻击);
	}

	@Override
	public boolean check(Fighter actor, Fighter target) {
		return checkOne(actor);
	}

	@Override
	public String toString() {
		return String.format("法术攻击时");
	}
}
